<template>
  <div>
    <el-table
      :data="tableData"
      style="width: 100%"
      border
      :height="height"
      :empty-text="emptyText"
    >
      <el-table-column
        v-for="item in tableConfigArr"
        :key="item.prop"
        v-bind="item"
      >
        <template slot="header">
          <template v-if="$slots[`header_${item.prop}`]">
            <slot :name="`header_${item.prop}`" />
          </template>
          <template v-else>{{ item.label }}</template>
        </template>

        <template slot-scope="scope">
          <template v-if="$scopedSlots[item.prop]">
            <slot :name="item.prop" :scope="scope" :item="item" />
          </template>
          <template v-else>{{ scope.row[item.prop] }} </template>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: "tabler",
  data() {
    return {};
  },
  methods: {},
  // mounted(){
  //   console.log(this.$scopedSlots)
  //   console.log(this.$slots)
  // },

  props: {
    tableData: {
      type: Array,
    },
    tableConfigArr: {
      type: Array,
      default: () => [],
    },
    height: {
      type: Number,
      default: "484",
    },
    emptyText: {
      type: String,
      default: "暂无数据",
    },
    rules: {},
    // handleFilter:{},
    // isselect:{}
  },
};
</script>
<style>
</style>
